
export function getList({type, params}){
	const apis = {
		'agent': '/agt/agenttransactioncumulative/getAgentTurnover',
		'merchant': '/mec/merchanttransactioncumulative/getMecTurnover'
	}
	
	return uni.$u.http.get(apis[type], {params})
}

export function getMecTradeTotal(params) {
	return uni.$u.http.get('/mec/merchanttransactioncumulative/getMecTurnoverByAgentNo', {params})
}

export function updateRate(params) {
	return uni.$u.http.post('/agt/agentratemodify/mofiyRate', params)
}

export function getDetail({agentNo, mno, type}) {
	const apiEnum = {
		'merchant': `/mec/merchant/getMerchantInfo?mno=${mno}`,
		'agent': `/agt/agentinfo/getLowerAgentInfo?agentNo=${agentNo}`
	}
	
	return uni.$u.http.get(apiEnum[type])
}

export function getTradeList({agentNo, mno, type, pageNum = 1, size = 10}) {
	const apiEnum = {
		'merchant': '/agt/agenttransactioncumulative/getMecTurnoverByMno',
		'agent': '/mec/merchanttransactioncumulative/getAgentTurnoverByAgentNo'
	}
	
	return uni.$u.http.get(apiEnum[type], {params: {agentNo, mno, pageNum, size}})
}

export function getSameNameList() {
	return uni.$u.http.post('/agt/agenttransferhis/sameNameMercList')
}

export function sameNameTransfer(mno) {
	return uni.$u.http.post(`/agt/agenttransferhis/sameNameMercTransfer?mno=${mno}`)
}
